<include file="public/layout" />
<link href="__PUBLIC__/static/css/jquery.searchableSelect.css" rel="stylesheet" type="text/css">
<!--<script src="__PUBLIC__/static/js/jquery-1.11.1.min.js"></script>-->
<script src="__PUBLIC__/static/js/jquery.searchableSelect.js"></script>
<body style="background-color: #FFF; overflow: auto;">
<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="fixed-bar">
        <div class="item-title"><a class="back" href="javascript:history.back();" title="返回列表"><i class="fa fa-arrow-circle-o-left"></i></a>
            <div class="subject">
                <h3>合伙人管理 - 编辑合伙人</h3>
                <h5>网站系统合伙人管理</h5>
            </div>
        </div>
    </div>
    <form class="form-horizontal" id="handleposition" method="post">
        <input type="hidden" name="act" value="{$act}">
        <!--<input type="hidden" name="user_id" value="{$info.user_id}">-->
        <div class="ncap-form-default">
            <dl class="row">
                <dt class="tit">
                    <label for="user_id"><em>*</em>合伙人昵称</label>
                </dt>
                <dd class="opt">
                    <select name="user_id" id="user_id"  class="select">
                        <option value="">请选择..</option>
                        <foreach name="usersList" item="v" key="k" >
                            <option value="{$v['user_id']}" <if condition="$v[user_id] eq $info['user_id']">selected="selected"</if>>{$v['nickname']}</option>
                        </foreach>
                    </select>
                    <span class="err" id="err_user_id"></span>
                    <p class="notic">设置合伙人昵称</p>
                </dd>
            </dl>
           <dl class="row">
                <dt class="tit">
                    <label for="type_id"><em>*</em>合伙人类型</label>
                </dt>
                <dd class="opt">
                    <select name="type_id" id="type_id"  class="select">
                        <option value="">请选择..</option>
                        <foreach name="userTypeList" item="v" key="k" >
                            <option value="{$v['type_id']}" <if condition="$v[type_id] eq $info['type_id']">selected="selected"</if>>{$v['type_name']}</option>
                        </foreach>
                    </select>
                    <span class="err" id="err_type_id"></span>
                    <p class="notic">设置合伙人类型</p>
                </dd>
            </dl>
            <div class="bot"><a href="JavaScript:void(0);" onclick="verifyForm()" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a></div>
        </div>
    </form>
</div>
<script type="text/javascript">
    function verifyForm(){
        $('span.err').show();
        $.ajax({
            type: "POST",
            url: "{:U('Admin/Partner/partnerHandle')}",
            data: $('#handleposition').serialize(),
            dataType: "json",
            error: function () {
                layer.alert("服务器繁忙, 请联系管理员!");
            },
            success: function (data) {
                if (data.status == 1) {
                    layer.msg(data.msg, {icon: 1});
                    location.href = "{:U('Admin/Partner/partnerList')}";
                } else {
                    layer.msg(data.msg, {icon: 2});
                    $.each(data.result, function (index, item) {
                        $('#err_' + index).text(item).show();
                    });
                }
            }
        });
    }
</script>
<script>
    $(function(){
        $('select').searchableSelect();
    });
</script>

</body>
</html>
